import { defHttp } from '/@/utils/http/axios';
import { IPostNoticesUpdateRaw } from '/@/types/system/notices/update';
import { IPostNoticesListRequest, IPostNoticesListResponse } from '/@/types/system/notices/list';
import { IGetRawNoticesDetailsResponse } from '/@/types/system/notices/details';
import { IPostNoticesDeleteQuery } from '/@/types/system/notices/delete';
import { IPostNoticesSaveRequest } from '/@/types/system/notices/save';

/**
 * 修改公告
 */
export const apiPostNoticesUpdatePath = (
  noticeId: string | number,
  params: IPostNoticesUpdateRaw,
) => defHttp.post({ url: `/system/notices/update/${noticeId}`, params });
/**
 * 公告列表
 */
export const apiPostNoticesList = (params: IPostNoticesListRequest) =>
  defHttp.post<IPostNoticesListResponse>({ url: `/system/notices/list`, params });
/**
 * 公告详情
 */
export const apiGetNoticesDetailsPath = (noticeId: string | number) =>
  defHttp.get<IGetRawNoticesDetailsResponse>({ url: `/system/notices/details/${noticeId}` });
/**
 * 删除公告
 */
export const apiPostNoticesDeleteQuery = (params: IPostNoticesDeleteQuery) =>
  defHttp.post({ url: `/system/notices/delete`, params });
/**
 * 添加公告
 */
export const apiPostNoticesSave = (params: IPostNoticesSaveRequest) =>
  defHttp.post({ url: `/system/notices/save`, params });
